<template>
    <div class="goodsdesc-container">
        <h3>{{ goodsDesc.title }}</h3>
        <hr>
        <div class="content">
            {{ goodsDesc.content }}
        </div>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                id: this.$route.params.id,
                goodsDesc: {}
            }
        },
        created() {
            this.getGoodsDesc();
        },
        methods: {
            getGoodsDesc() {
                this.$http.get('home/GoodsDesc.json?id=' + this.id).then( result => {
                    if (result.body.status === 0) {
                        this.goodsDesc = result.body.message[0];
                    }
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
.goodsdesc-container {
    padding: 2px;

    h3 {
        text-align: center;
        font-size: 16px;
    }
    .content {
        font-size: 14px;
        text-indent: 2em;
    }
}
</style>
